import sqlite3

# 连接数据库
conn = sqlite3.connect('yetian.db')
cursor = conn.cursor()

# 查询表结构
cursor.execute('PRAGMA table_info(news)')
columns = cursor.fetchall()

print("News表的列信息:")
for column in columns:
    print(f"列名: {column[1]}, 类型: {column[2]}")

# 尝试查询一条数据查看实际内容
cursor.execute('SELECT * FROM news LIMIT 1')
row = cursor.fetchone()
if row:
    print("\n示例数据:")
    for i, column in enumerate(columns):
        print(f"{column[1]}: {row[i]}")

# 关闭连接
conn.close()